Data storage devices are widely used by host devices, such as desktop computers, laptop computers, personal digital assistants, digital picture/video recorders/players, and digital music recorders/players, to store/retrieve digital data. Some types of data storage devices include magnetic disk drives, optical disk drives, electro-optical disk drives, and magnetic tape drives. A common characteristic of these data storage devices is that they include data storage media that moves relative to one or more read/write transducers. Data is written to/read from a defined location on the media by controllably moving the media and/or the read/write transducer relative to one another so that the read/write transducer can access the defined location on the media. As can be appreciated, such controlled movements take time which can decrease the data storage/retrieval bandwidth of the data storage device.
In an attempt to increase storage/retrieval bandwidth, some data storage devices temporarily store data that has been read from the media into a memory buffer until the data can be output to the host, and may temporarily store data received from the host in the memory buffer until the data can be written to the media. The data storage device may operate in a Write Cache Enabled mode in which it acknowledges to the host that a write command has been completed after the data received from the host device has been stored in the memory buffer, but prior to the data actually being written to the media.
The data is typically appended with an error detection code to provide a data integrity check capability between data that is stored in the data storage device and then subsequently retrieved therefrom. The error detection code may be appended as another word at the end of the data so as to be compatible with conventional memory buffer widths and to facilitate the writing/reading of the data and corresponding error detection code to/from the media.
When data is read from the media, the error detection code is used to determine if the data has sustained any errors while it was stored on the media and/or while it was being read from and/or written to the media. When errors are identified, further attempts may be made to read error-free data from the media. For example, in response to detecting a data error while carrying out a read command from a host, the data storage device may inform the host that a data error has occurred and request the host to initiate re-reading of the data via a subsequent read command. As can be appreciated, such attempts to re-read the data can introduce an undesirable delay in outputting the data to the host, and the data error indication to the host may be undesirably interpreted by a user as a general failure of the data storage device.
When the data storage device is operating in the Write Cache Enabled mode, if the data is corrupted after the data storage device has acknowledged to the host that a write command has been completed, the data storage device may not be able to subsequently request that the host resend that data thereto, since the host may have already released resources holding the data and/or references to it. Accordingly, the data may be lost.
Some data storage devices may also append an error correction code to the data and associated error detection code that are stored on the media. Error correction codes may be applied to individual data words and/or to blocks of data words. A data storage device may thereby identify errors when reading data from the media using the error detection code, and may then attempt to correct errors using the error correction code. Unfortunately, stronger error detection codes (i.e., codes that can detect more data errors) and stronger error correction codes (i.e., codes that can correct more data errors) typically increase, and may substantially increase, the combined length of the data and appended codes relative to weaker codes. Moreover, memory buffers are typically available in bit widths based on a power of 2. For example, a 16-bit length data word that is protected using a per-word error correction code may result in 21 bits of data and appended error correction code. The 21 bit length data and code may necessitate that the data storage device use a 32-bit wide memory buffer to temporarily buffer the data and appended error correction code while it awaits writing to the media, which results in less efficient use of the memory buffer.